#include <iostream>
using namespace std;
int N, M, T;
int flag[10][10];
int dx[4] = {0, -1, 0, 1};
int dy[4] = {1, 0, -1, 0};
int ans = 0;
void dfs(int x, int y, int r, int l) {
    if(x == r && y == l) {
        ans++;
        return;
    }
    for(int i = 0; i < 4; i++){
        int row = x + dx[i], col = y + dy[i];
        if(row >= 0 && row < N && col >= 0 && col < M && flag[row][col] == 0) {
            flag[row][col] = 1;
            dfs(row, col, r, l);
            flag[row][col] = 0;
        }
    }
}
int main() {
    cin >> N >> M >> T;
    int sx, sy, fx, fy;
    cin >> sx  >> sy >> fx >> fy;
    sx--;
    sy--;
    fx--;
    fy--;
    for(int i = 0; i < T; i++) {
        int x, y;
        cin >> x >> y;
        x--;
        y--;
        flag[x][y] = -1;
    }
    flag[sx][sy] = 1;
    dfs(sx, sy, fx, fy);
    cout << ans << endl;
    return 0;
}


